package com.five.api;

import com.five.pojo.Menu;
import com.five.pojo.User;
import com.five.result.Result;
import com.five.vo.NovelRankVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient(name="user-service", contextId = "userServiceAPI")
public interface UserServiceAPI {
    
    @PostMapping("user/user/queryByLoginInfoId/{loginInfoId}")
    public Result<User> queryByLoginInfoId(@PathVariable Long loginInfoId);

    @PostMapping("user/user/insertUser")
    public Result insertUser(@RequestBody User user);

    @PostMapping("user/user/updateUser")
    public Result updateUser(@RequestBody User user);

    /**
     *根据账号查询员工信息
     * @param
     * @return
     */
    @PostMapping("user/user/queryByAccount/{account}")
    public Result<User> queryByAccount(@PathVariable String account);

    @PostMapping("/user/menu/queryByUserId/{userId}")
    public Result<List<Menu>> queryMenusByUserId(@PathVariable Long userId);

    @PostMapping("/user/permission/queryByUserId/{userId}")
    public Result<List<String>> queryPermissionsByUserId(@PathVariable Long userId);

    @PostMapping("/queryAll")
    Result queryAll();

    @PostMapping("/queryById")
    Result queryById(Long id);

    @PostMapping("/queryPage")
    Result queryPage(@RequestBody User user);

    @PostMapping("/delete/{id}")
    Result delete(@PathVariable("id") Long id);

    @PostMapping("/deleteBatch")
    Result deleteBatch(@RequestBody List<Long> ids);

    /**
     * 根据分类查询小说
     */
    @PostMapping("/user/novel/listNovelByCategory")
    Result<List<NovelRankVo>> listNovelByCategory(@RequestBody Map<String, Long> params);

}